package com.wmh.baseservice.user.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;

import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author mmx generator
 * @since 2021-10-27
 */
@ApiModel(value="Role对象", description="")
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String role;

    private String permission;

    public Integer getId() {
        return id;
    }

    public Role setId(Integer id) {
        this.id = id;
        return this;
    }
    public String getRole() {
        return role;
    }

    public Role setRole(String role) {
        this.role = role;
        return this;
    }
    public String getPermission() {
        return permission;
    }

    public Role setPermission(String permission) {
        this.permission = permission;
        return this;
    }

    public static final String ID = "id";

    public static final String ROLE = "role";

    public static final String PERMISSION = "permission";

    @Override
    public String toString() {
        return "Role{" +
            "id=" + id +
            ", role=" + role +
            ", permission=" + permission +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            Role.ID
            ,Role.ROLE
            ,Role.PERMISSION
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}